
package com.hmsg.health.dao;

import com.hmsg.health.bean.domain.AdminUserDo;
import com.hmsg.health.bean.domain.TaskDo;
import com.hmsg.health.bean.domain.UserDo;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface AdminUserDao {
    @Select("select * from s_admin_user where id=#{id}")
    AdminUserDo findOne(@Param("id")Integer id);
    
    @Select("select * from s_admin_user where mobile=#{mobile}")
    AdminUserDo selectByMobile(String mobile);
 
  


    @Select("<script>" +
    	    "select * from  `s_admin_user` where 1=1 " +
    	    "    <if test='info.id != null'>" +
    	    "     and `id` = #{info.id} " +
    	    "    </if>" +
    	
    	    "    <if test='info.userName != null'>" +
    	    "    and  `user_name` = #{info.userName} " +
    	    "    </if>" +
    	    "    <if test='info.realName != null'>" +
    	    "    and  `real_name` = #{info.realName} " +
    	    "    </if>" +
    	    "    <if test='info.password != null'>" +
    	    "      and password  = #{info.password} " +
    	    "    </if>" +
    	    "    <if test='info.mobile != null'>" +
    	    "      and `mobile` = #{info.mobile}  " +
    	    "    </if>" +
    	 
    	    "</script>")
  
    List<AdminUserDo> select(@Param("info") AdminUserDo info);
    

   
}